\hypertarget{class_q_c_p_item_rect}{}\section{Q\+C\+P\+Item\+Rect Class Reference}
\label{class_q_c_p_item_rect}\index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}


A rectangle.  


Inheritance diagram for Q\+C\+P\+Item\+Rect\+:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=4.000000cm]{class_q_c_p_item_rect}
\end{center}
\end{figure}
\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_q_c_p_item_rect_a412ad1579f7a1fba453d0fa28c496cbc}{Q\+C\+P\+Item\+Rect}} (\mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}} $\ast$parent\+Plot)
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_a3ee2f580a3950dc11247f405ce8b6ecf}\label{class_q_c_p_item_rect_a3ee2f580a3950dc11247f405ce8b6ecf}} 
Q\+Pen {\bfseries pen} () const
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_abd93cf93404ce827dfae71d9d9d08b29}\label{class_q_c_p_item_rect_abd93cf93404ce827dfae71d9d9d08b29}} 
Q\+Pen {\bfseries selected\+Pen} () const
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_a5071d7fd864428a1398152aca87b54ad}\label{class_q_c_p_item_rect_a5071d7fd864428a1398152aca87b54ad}} 
Q\+Brush {\bfseries brush} () const
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_a2b0a6852bc92d716c7e811c90de2c1a9}\label{class_q_c_p_item_rect_a2b0a6852bc92d716c7e811c90de2c1a9}} 
Q\+Brush {\bfseries selected\+Brush} () const
\item 
void \mbox{\hyperlink{class_q_c_p_item_rect_a483c0da5a17e1646cd17ddea2c124e7d}{set\+Pen}} (const Q\+Pen \&pen)
\item 
void \mbox{\hyperlink{class_q_c_p_item_rect_a52a1bcb2dc753a538e406a2ba3cf21ce}{set\+Selected\+Pen}} (const Q\+Pen \&pen)
\item 
void \mbox{\hyperlink{class_q_c_p_item_rect_abbd4e346a03513ee466afc25d9c75446}{set\+Brush}} (const Q\+Brush \&brush)
\item 
void \mbox{\hyperlink{class_q_c_p_item_rect_abd1792859844118dedee86223cede7af}{set\+Selected\+Brush}} (const Q\+Brush \&brush)
\item 
virtual double \mbox{\hyperlink{class_q_c_p_item_rect_abe1a6091591d3bad5e4efab2331f99ec}{select\+Test}} (const Q\+PointF \&pos, bool only\+Selectable, Q\+Variant $\ast$details=0) const
\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_aa70feeef173489b03c3fbe906a5023c4}\label{class_q_c_p_item_rect_aa70feeef173489b03c3fbe906a5023c4}} 
\mbox{\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position}} $\ast$const {\bfseries top\+Left}
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_a409f3bfe615a7e322bb3d4d193d85b26}\label{class_q_c_p_item_rect_a409f3bfe615a7e322bb3d4d193d85b26}} 
\mbox{\hyperlink{class_q_c_p_item_position}{Q\+C\+P\+Item\+Position}} $\ast$const {\bfseries bottom\+Right}
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_a96e50db552fb297d6fb62614676217bc}\label{class_q_c_p_item_rect_a96e50db552fb297d6fb62614676217bc}} 
\mbox{\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor}} $\ast$const {\bfseries top}
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_a77e0eb6e4aa6efee620d35e2c21bdad7}\label{class_q_c_p_item_rect_a77e0eb6e4aa6efee620d35e2c21bdad7}} 
\mbox{\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor}} $\ast$const {\bfseries top\+Right}
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_a7979c1915f61ad2609a9cc179c2e445e}\label{class_q_c_p_item_rect_a7979c1915f61ad2609a9cc179c2e445e}} 
\mbox{\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor}} $\ast$const {\bfseries right}
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_a99313bf2b338d9f81e19bd38082038aa}\label{class_q_c_p_item_rect_a99313bf2b338d9f81e19bd38082038aa}} 
\mbox{\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor}} $\ast$const {\bfseries bottom}
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_abd8ee63fdf81f0c74bf7ccadee8603da}\label{class_q_c_p_item_rect_abd8ee63fdf81f0c74bf7ccadee8603da}} 
\mbox{\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor}} $\ast$const {\bfseries bottom\+Left}
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_aad0ca1af0c8debfc20d7b47fc942764d}\label{class_q_c_p_item_rect_aad0ca1af0c8debfc20d7b47fc942764d}} 
\mbox{\hyperlink{class_q_c_p_item_anchor}{Q\+C\+P\+Item\+Anchor}} $\ast$const {\bfseries left}
\end{DoxyCompactItemize}
\subsection*{Protected Types}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_af0ebba58e6bca4851c4db726691ec0d3}\label{class_q_c_p_item_rect_af0ebba58e6bca4851c4db726691ec0d3}} 
enum {\bfseries Anchor\+Index} \{ \newline
{\bfseries ai\+Top}, 
{\bfseries ai\+Top\+Right}, 
{\bfseries ai\+Right}, 
{\bfseries ai\+Bottom}, 
\newline
{\bfseries ai\+Bottom\+Left}, 
{\bfseries ai\+Left}
 \}
\end{DoxyCompactItemize}
\subsection*{Protected Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_a18cd583638b876cdd50f1a155ec182aa}\label{class_q_c_p_item_rect_a18cd583638b876cdd50f1a155ec182aa}} 
virtual void {\bfseries draw} (\mbox{\hyperlink{class_q_c_p_painter}{Q\+C\+P\+Painter}} $\ast$painter)
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_af1c42e6142d1137673335982856d0ea6}\label{class_q_c_p_item_rect_af1c42e6142d1137673335982856d0ea6}} 
virtual Q\+PointF {\bfseries anchor\+Pixel\+Point} (int anchor\+Id) const
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_af94d87da501e9429c0e874f1c0369b03}\label{class_q_c_p_item_rect_af94d87da501e9429c0e874f1c0369b03}} 
Q\+Pen {\bfseries main\+Pen} () const
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_a8813d2d670835ac9b8000c981b8ea6fe}\label{class_q_c_p_item_rect_a8813d2d670835ac9b8000c981b8ea6fe}} 
Q\+Brush {\bfseries main\+Brush} () const
\end{DoxyCompactItemize}
\subsection*{Protected Attributes}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_aa0d49323628d6752026056bfb52afd86}\label{class_q_c_p_item_rect_aa0d49323628d6752026056bfb52afd86}} 
Q\+Pen {\bfseries m\+Pen}
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_a73cc0bee61de3c67221ec8c7a76a29ed}\label{class_q_c_p_item_rect_a73cc0bee61de3c67221ec8c7a76a29ed}} 
Q\+Pen {\bfseries m\+Selected\+Pen}
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_a2d7f207fada27588b3a52b19234d3c2e}\label{class_q_c_p_item_rect_a2d7f207fada27588b3a52b19234d3c2e}} 
Q\+Brush {\bfseries m\+Brush}
\item 
\mbox{\Hypertarget{class_q_c_p_item_rect_a21b70eee59b6e19ae0bbdf037b13508f}\label{class_q_c_p_item_rect_a21b70eee59b6e19ae0bbdf037b13508f}} 
Q\+Brush {\bfseries m\+Selected\+Brush}
\end{DoxyCompactItemize}
\subsection*{Additional Inherited Members}


\subsection{Detailed Description}
A rectangle. 

 It has two positions, {\itshape top\+Left} and {\itshape bottom\+Right}, which define the rectangle. 

\subsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_q_c_p_item_rect_a412ad1579f7a1fba453d0fa28c496cbc}\label{class_q_c_p_item_rect_a412ad1579f7a1fba453d0fa28c496cbc}} 
\index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}!Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}
\index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}!Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}
\subsubsection{\texorpdfstring{Q\+C\+P\+Item\+Rect()}{QCPItemRect()}}
{\footnotesize\ttfamily Q\+C\+P\+Item\+Rect\+::\+Q\+C\+P\+Item\+Rect (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}} $\ast$}]{parent\+Plot }\end{DoxyParamCaption})}

Creates a rectangle item and sets default values.

The constructed item can be added to the plot with \mbox{\hyperlink{class_q_custom_plot_aa500620379262321685cb7a7674cbd2a}{Q\+Custom\+Plot\+::add\+Item}}. 

\subsection{Member Function Documentation}
\mbox{\Hypertarget{class_q_c_p_item_rect_abe1a6091591d3bad5e4efab2331f99ec}\label{class_q_c_p_item_rect_abe1a6091591d3bad5e4efab2331f99ec}} 
\index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}!select\+Test@{select\+Test}}
\index{select\+Test@{select\+Test}!Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}
\subsubsection{\texorpdfstring{select\+Test()}{selectTest()}}
{\footnotesize\ttfamily double Q\+C\+P\+Item\+Rect\+::select\+Test (\begin{DoxyParamCaption}\item[{const Q\+PointF \&}]{pos,  }\item[{bool}]{only\+Selectable,  }\item[{Q\+Variant $\ast$}]{details = {\ttfamily 0} }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [virtual]}}

This function is used to decide whether a click hits a layerable object or not.

{\itshape pos} is a point in pixel coordinates on the \mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}} surface. This function returns the shortest pixel distance of this point to the object. If the object is either invisible or the distance couldn\textquotesingle{}t be determined, -\/1.\+0 is returned. Further, if {\itshape only\+Selectable} is true and the object is not selectable, -\/1.\+0 is returned, too.

If the object is represented not by single lines but by an area like a \mbox{\hyperlink{class_q_c_p_item_text}{Q\+C\+P\+Item\+Text}} or the bars of a \mbox{\hyperlink{class_q_c_p_bars}{Q\+C\+P\+Bars}} plottable, a click inside the area should also be considered a hit. In these cases this function thus returns a constant value greater zero but still below the parent plot\textquotesingle{}s selection tolerance. (typically the selection\+Tolerance multiplied by 0.\+99).

Providing a constant value for area objects allows selecting line objects even when they are obscured by such area objects, by clicking close to the lines (i.\+e. closer than 0.\+99$\ast$selection\+Tolerance).

The actual setting of the selection state is not done by this function. This is handled by the parent \mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}} when the mouse\+Release\+Event occurs, and the finally selected object is notified via the select\+Event/deselect\+Event methods.

{\itshape details} is an optional output parameter. Every layerable subclass may place any information in {\itshape details}. This information will be passed to select\+Event when the parent \mbox{\hyperlink{class_q_custom_plot}{Q\+Custom\+Plot}} decides on the basis of this select\+Test call, that the object was successfully selected. The subsequent call to select\+Event will carry the {\itshape details}. This is useful for multi-\/part objects (like \mbox{\hyperlink{class_q_c_p_axis}{Q\+C\+P\+Axis}}). This way, a possibly complex calculation to decide which part was clicked is only done once in \mbox{\hyperlink{class_q_c_p_item_rect_abe1a6091591d3bad5e4efab2331f99ec}{select\+Test}}. The result (i.\+e. the actually clicked part) can then be placed in {\itshape details}. So in the subsequent select\+Event, the decision which part was selected doesn\textquotesingle{}t have to be done a second time for a single selection operation.

You may pass 0 as {\itshape details} to indicate that you are not interested in those selection details.

\begin{DoxySeeAlso}{See also}
select\+Event, deselect\+Event, \mbox{\hyperlink{class_q_custom_plot_a5ee1e2f6ae27419deca53e75907c27e5}{Q\+Custom\+Plot\+::set\+Interactions}} 
\end{DoxySeeAlso}


Implements \mbox{\hyperlink{class_q_c_p_abstract_item_a96d522d10ffc0413b9a366c6f7f0476b}{Q\+C\+P\+Abstract\+Item}}.

\mbox{\Hypertarget{class_q_c_p_item_rect_abbd4e346a03513ee466afc25d9c75446}\label{class_q_c_p_item_rect_abbd4e346a03513ee466afc25d9c75446}} 
\index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}!set\+Brush@{set\+Brush}}
\index{set\+Brush@{set\+Brush}!Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}
\subsubsection{\texorpdfstring{set\+Brush()}{setBrush()}}
{\footnotesize\ttfamily void Q\+C\+P\+Item\+Rect\+::set\+Brush (\begin{DoxyParamCaption}\item[{const Q\+Brush \&}]{brush }\end{DoxyParamCaption})}

Sets the brush that will be used to fill the rectangle. To disable filling, set {\itshape brush} to Qt\+::\+No\+Brush.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_item_rect_abd1792859844118dedee86223cede7af}{set\+Selected\+Brush}}, \mbox{\hyperlink{class_q_c_p_item_rect_a483c0da5a17e1646cd17ddea2c124e7d}{set\+Pen}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_item_rect_a483c0da5a17e1646cd17ddea2c124e7d}\label{class_q_c_p_item_rect_a483c0da5a17e1646cd17ddea2c124e7d}} 
\index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}!set\+Pen@{set\+Pen}}
\index{set\+Pen@{set\+Pen}!Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}
\subsubsection{\texorpdfstring{set\+Pen()}{setPen()}}
{\footnotesize\ttfamily void Q\+C\+P\+Item\+Rect\+::set\+Pen (\begin{DoxyParamCaption}\item[{const Q\+Pen \&}]{pen }\end{DoxyParamCaption})}

Sets the pen that will be used to draw the line of the rectangle

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_item_rect_a52a1bcb2dc753a538e406a2ba3cf21ce}{set\+Selected\+Pen}}, \mbox{\hyperlink{class_q_c_p_item_rect_abbd4e346a03513ee466afc25d9c75446}{set\+Brush}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_item_rect_abd1792859844118dedee86223cede7af}\label{class_q_c_p_item_rect_abd1792859844118dedee86223cede7af}} 
\index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}!set\+Selected\+Brush@{set\+Selected\+Brush}}
\index{set\+Selected\+Brush@{set\+Selected\+Brush}!Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}
\subsubsection{\texorpdfstring{set\+Selected\+Brush()}{setSelectedBrush()}}
{\footnotesize\ttfamily void Q\+C\+P\+Item\+Rect\+::set\+Selected\+Brush (\begin{DoxyParamCaption}\item[{const Q\+Brush \&}]{brush }\end{DoxyParamCaption})}

Sets the brush that will be used to fill the rectangle when selected. To disable filling, set {\itshape brush} to Qt\+::\+No\+Brush.

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_item_rect_abbd4e346a03513ee466afc25d9c75446}{set\+Brush}} 
\end{DoxySeeAlso}
\mbox{\Hypertarget{class_q_c_p_item_rect_a52a1bcb2dc753a538e406a2ba3cf21ce}\label{class_q_c_p_item_rect_a52a1bcb2dc753a538e406a2ba3cf21ce}} 
\index{Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}!set\+Selected\+Pen@{set\+Selected\+Pen}}
\index{set\+Selected\+Pen@{set\+Selected\+Pen}!Q\+C\+P\+Item\+Rect@{Q\+C\+P\+Item\+Rect}}
\subsubsection{\texorpdfstring{set\+Selected\+Pen()}{setSelectedPen()}}
{\footnotesize\ttfamily void Q\+C\+P\+Item\+Rect\+::set\+Selected\+Pen (\begin{DoxyParamCaption}\item[{const Q\+Pen \&}]{pen }\end{DoxyParamCaption})}

Sets the pen that will be used to draw the line of the rectangle when selected

\begin{DoxySeeAlso}{See also}
\mbox{\hyperlink{class_q_c_p_item_rect_a483c0da5a17e1646cd17ddea2c124e7d}{set\+Pen}}, \mbox{\hyperlink{class_q_c_p_abstract_item_a203de94ad586cc44d16c9565f49d3378}{set\+Selected}} 
\end{DoxySeeAlso}


The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
R\+:/\+Develop/a0-\/develop/\+Lib\+Q\+Qt/src/charts/qcustomplot/\mbox{\hyperlink{qcustomplot_8h}{qcustomplot.\+h}}\item 
R\+:/\+Develop/a0-\/develop/\+Lib\+Q\+Qt/src/charts/qcustomplot/\mbox{\hyperlink{qcustomplot_8cpp}{qcustomplot.\+cpp}}\end{DoxyCompactItemize}
